<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org" th:with="title=${catalog.catalogName},active='catalog'"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<!-- head 头部-->
<head th:replace="web/common/fragment::head(${title},null,'')"></head>
	<body>

		<div th:replace="web/layout/header::header(${active})"></div>
		<!--	main	-->
		<div class="fly-main">
				<div class="layui-row clear layui-col-space15">
					<div class="lanmu-header">
						<div class="lanmu-header-info">
							<div class="lanmu-header-info-avatar">
								<a href="#">
									<img th:src="${catalog.catalogImage ?:'/assets/images/portal_user_img.png'}" class="avatar opacity"></a>
							</div>

							<div class="lanmu-header-info-top">
								<a class="title" th:text="${catalog.catalogName}">栏目板块名称</a>
								<span class="countInfo">
		  	 				<span>帖子：<m class="num" th:text="${catalog.postCount ?:'0'}">999</m></span>
		  	 				<span>互动：<m class="num" th:text="${catalog.commentCount ?:'0'}">9999</m></span>
		  	 			</span>
								<span class="publishBtn" th:data-id="${catalog.catalogId}" onclick="publish(this.getAttribute('data-id'))">
		  	 				<i class="layui-icon layui-icon-release"></i> 发帖
		  	 			</span>
							</div>
							<div class="lanmu-header-info-desc">
								<p th:text="${catalog.catalogDesc ?:'当前栏目板块无具体描述！'}">板块描述</p>
							</div>
						</div>
					</div>
				</div>
				<div class="layui-row clear layui-col-space15">
					<div class="layui-col-md8">
						<div class="fly-panel"  th:if="${not #lists.isEmpty(listTopArticles)}">
							<div class="fly-panel-title fly-filter">
								<a>全站置顶</a>
							</div>

							<ul class="fly-list">
								<li th:each="article,iterStat:${listTopArticles}">
									<a th:href="'/user/'+${article.userId}" class="fly-avatar">
										<span class="vip-icon" th:if="${article.author.userGrade==1}"></span>
										<img th:src="${thUtil.formatUserImage(article.author.userImg)}" th:alt="${article.author.nickName}">
									</a>
									<h2>
										<a class="layui-badge layui-bg-black">置顶</a>
										<a th:href="'/post/'+${article.postId}" th:text="${article.postTitle}">帖子标题</a>
										<span th:replace="web/common/template::mark2(${article})"></span>
									</h2>
									<div class="fly-list-info">
										<a href="user/home.html" link>
											<cite th:text="${article.author.nickName}">unknow</cite>
										</a>
										<span th:text="${thUtil.formatPublishDate(article.createTime)}">刚刚</span>

										<span class="fly-list-nums">
							              	<i class="layui-icon iconfont ali-icon-chakan" title="查看"></i><th:block th:text="${article.clickCount}">9999</th:block>
							                <i class="layui-icon layui-icon-dialogue" title="评论"></i><th:block th:text="${article.commentCount}">9999</th:block>
							              </span>
									</div>
								</li>
							</ul>
						</div>

						<div class="fly-panel">
							<div class="fly-panel-title">
								<div class="catalog-filter clear">
									<div class="left">
                                        <li class="newest"><a th:href="'/post/'+${catalog.catalogId}+'/1?newest=1'">最新</a></li>
										<li class="hot"><a th:href="'/post/'+${catalog.catalogId}+'/1?hot=1'">点击量</a></li>
										<li class="support"><a th:href="'/post/'+${catalog.catalogId}+'/1?postSupport=1'">精华</a></li>
									</div>
									<!--<div class="right">
										<input type="text" class="" id="keywords" placeholder="搜索内容"/>
										<i th:onclick="|catalog-search(${catalog.catalogId})|" class="layui-icon layui-icon-search"></i>
									</div>-->
								</div>
							</div>
							<ul class="fly-list" th:if="${not #lists.isEmpty(listArticles)}">
								<li th:each="article,iterStat:${listArticles}">
									<a th:href="'/user/'+${article.userId}" class="fly-avatar">
										<span class="vip-icon" th:if="${article.author.userGrade==1}"></span>
										<img th:src="${thUtil.formatUserImage(article.author.userImg)}" th:alt="${article.author.nickName}" class="avatar opacity">
									</a>
									<h2>
										<a th:if="${article.postTop==1}" class="layui-badge layui-bg-black">置顶</a>
										<a class="layui-badge" th:if="${thUtil.isNewest(article.createTime)}">最新</a>
										<a th:href="'/post/'+${article.postId}" th:text="${article.postTitle}">帖子标题</a>
										<span th:replace="web/common/template::mark2(${article})"></span>
									</h2>
									<div class="fly-list-info">

										<a th:href="'/user/'+${article.userId}" link>
											<i class="layui-icon layui-icon-username"></i>
											<cite th:text="${article.author.nickName}">unknow</cite>
											<!-- <i class="iconfont icon-renzheng" title="认证信息：XXX"></i> -->
											<!--<i shiro:hasRole="administrator" class="layui-badge fly-badge-vip">超级管理员</i>-->
											<!--<i class="layui-badge fly-badge-vip" th:if="${article.author.userGrade==1}">vip</i>-->
										</a>
										<span th:text="${thUtil.formatPublishDate(article.createTime)}">刚刚</span>
										<th:block th:if="${article.lastComment != null}">
										<span>最后回复</span>
										<a th:href="'/user/'+${article.lastComment.user.id}" link>
											<i class="layui-icon layui-icon-username"></i>
											<cite th:text="${article.lastComment.user.nickName}">顾得龙</cite>
											<i th:if="${article.lastComment.user.userGrade==1}" class="layui-badge fly-badge-vip">VIP</i>
										</a>
											<span th:text="${thUtil.formatPublishDate(article.lastComment.createTime)}">刚刚</span>
										</th:block>
										<!--<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">最后回复</span>-->
										<!--<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>-->
										<span class="fly-list-nums">
							              	<i class="layui-icon iconfont ali-icon-chakan" title="查看"></i><th:block th:text="${article.clickCount}">9999</th:block>
							                <i class="layui-icon layui-icon-dialogue" title="评论"></i><th:block th:text="${article.commentCount}">9999</th:block>
							              </span>
									</div>
									<!--<div class="fly-list-badge">
										<span th:if="${article.postTop==1}" class="layui-badge layui-bg-black">置顶</span>
										<span th:if="${article.postSupport==1}" class="layui-badge layui-bg-red">精帖</span>
									</div>-->
								</li>
							</ul>
							<div class="fly-none" th:if="${#lists.isEmpty(listArticles)}">暂时还没有数据，期待您的发帖哟。</div>
							<ul class="pagination" th:utext="${pagination}"></ul>
						</div>

					</div>
					<!--	侧栏	-->
					<div class="layui-col-md4">

						<div th:replace="web/layout/sidebar::quickNavBar"></div>
						<div th:replace="web/layout/sidebar::rankUsersBar"></div>
						<div th:replace="web/layout/sidebar::recommenedBar">

						</div>
						<div th:replace="web/layout/sidebar::hotBar">

						</div>


					</div>


				</div>

		</div>
		<!--	contianer end	-->
<!--	底部版权		-->
<div th:replace="web/layout/footer::footer"></div>
<!--	搜索		-->
<div th:replace="web/layout/common::pop-search"></div>
<!--	右边工具栏	-->
<div th:replace="web/layout/common::right-bar"></div>
<!--	引入JS	-->
<div th:replace="web/common/fragment::js"></div>
<script th:inline="javascript">
    /*<![CDATA[*/
    function publish(catalogId){

        if(!isLogin){
            B.error("请先登录！");
            return;
        }else{
            window.location.href="/post/publish?catalogId="+catalogId;
        }
    }

    //$(obj).addClass('on').siblings().removeClass('on');
    if(B.getUrl().indexOf("?")==-1){
        $('.catalog-filter li.newest').addClass('on').siblings().removeClass('on');
    }
    if(!B.isEmpty(B.getUrlParam("newest"))){
        $('.catalog-filter li.newest').addClass('on').siblings().removeClass('on');
    }
    if(!B.isEmpty(B.getUrlParam("hot"))){
        $('.catalog-filter li.hot').addClass('on').siblings().removeClass('on');
    }
    if(!B.isEmpty(B.getUrlParam("postSupport"))){
        $('.catalog-filter li.support').addClass('on').siblings().removeClass('on');
    }
    /*]]>*/
</script>		
	</body>
</html>
